/*
 * @Author: doing
 * @Date: 2023-08-19 01:14:19
 * @LastEditors: git config user.name && git config user.email
 * @LastEditTime: 2023-08-27 00:12:04
 * @FilePath: \background-management-system\src\api\role.js
 * @Description: 
 * 角色接口
 * Copyright (c) 2023 by 1540265624@qq.com, All Rights Reserved. 
 */
import axios from '~/axios.js'
//根据id查询该角色所拥有的权限ids
export function getMenuids (id){
    return axios.get(`/system/role/${id}/menu/ids`)
}

//获取到所有的菜单权限
export function getMenus(body){
    return axios.post('/system/menu/search',body)
}

//查找角色信息(不传递默认查找全部,不分页)
export function searchRole(body){
    return axios.post('/system/role/search',body)
}

//新增角色
export function addRole(body){
    return axios.post('system/role',body)
}

//更新角色
export function updataRole(body){
    return axios.put('system/role',body)
}

//提交角色权限数据
export function updataRoleMenu(id,body){
    return axios.post(`/system/role/${id}/menu/save`,body)
}
//根据id删除角色数据
export function deleteRole(id){
    return axios.delete(`/system/role/${id}`)
}